summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Bindings/ManualBindings.cpp6
-rw-r--r--src/Map.h5
2 files changed, 8 insertions, 3 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index e93b11eaa..035be55ae 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -638,11 +638,11 @@ static int tolua_DoWithID(lua_State* tolua_S)
private:
virtual bool Item(Ty2 * a_Item) override
{
- lua_rawgeti(LuaState, LUA_REGISTRYINDEX, FuncRef); // Push function to call
- tolua_pushusertype(LuaState, a_Item, Ty2::GetClassStatic()); // Push the item
+ lua_rawgeti(LuaState, LUA_REGISTRYINDEX, FuncRef); // Push function to call
+ tolua_pushusertype(LuaState, a_Item, a_Item->GetClass()); // Push the item
if (TableRef != LUA_REFNIL)
{
- lua_rawgeti(LuaState, LUA_REGISTRYINDEX, TableRef); // Push the optional callbackdata param
+ lua_rawgeti(LuaState, LUA_REGISTRYINDEX, TableRef); // Push the optional callbackdata param
}
int s = lua_pcall(LuaState, (TableRef == LUA_REFNIL ? 1 : 2), 1, 0);
diff --git a/src/Map.h b/src/Map.h
index fe324a5e7..3e775231a 100644
--- a/src/Map.h
+++ b/src/Map.h
@@ -189,6 +189,11 @@ public:
return "cMap";
}
+ const char * GetClass(void) // Needed for ManualBindings' DoWith templates
+ {
+ return "cMap";
+ }
+
protected: